﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    public class ZhiJiModel
    {
        private bool isselected = false;
        [DataMember]
        public bool IsSelected
        {
            get { return isselected; }
            set { isselected = value; }
        }

        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        private string _DutyLevel = string.Empty;
        [DataMember]
        public string DutyLevel
        {
            get { return _DutyLevel; }
            set { _DutyLevel = value; }
        }

        private string _JinE = string.Empty;
        [DataMember]
        public string JinE
        {
            get { return _JinE; }
            set { _JinE = value; }
        }
        public static ZhiJiModel FillEntity(DataRow dr)
        {
            ZhiJiModel right = new ZhiJiModel();
            if (dr.Table != null && dr.Table.Columns.Contains("ID")) right.ID = Convert.ToInt32(dr["ID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("DutyLevel")) right.DutyLevel = dr["DutyLevel"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JinE")) right.JinE = dr["JinE"].ToString();
            return right;
        }
    }
}
